#ifndef _NE_LIGHT_H_
#define _NE_LIGHT_H_

#include <mathematics/Vector4.h>
#include <mathematics/Color.h>
#include <mathematics/Node.h>
#include <graphics/RenderSystemDefine.h>

namespace ne
{
    class NEAPI Light : public Node
    {
        public:
            Light();

            virtual void setScale(const Vector3 &v);

            void setType(const LightType &lt);

            LightType getType() const;

            void setAmbient(const Color &a);

            Color getAmbient() const;

            void setDiffuse(const Color &a);

            Color getDiffuse() const;

            void setSpecular(const Color &a);

            Color getSpecular() const;

            void setSpotExponent(const real a);

            real getSpotExponent() const;

            // [0.0f, 90.0f] and [180.0f]
            void setSpotCutOffAngle(const real a);

            real getSpotCutOffAngle() const;

            void setAttenuationFactor(const LightAttenuationType at, const real a);

            real getAttenuationFactor(const LightAttenuationType at) const;

            void useLight(const bool use=true, const uint32_t index=0);

            const Matrix4& getViewMatrix() const;

            virtual ~Light();

        private:
            LightType mType;
            Color mAmbient;
            Color mDiffuse;
            Color mSpecular;
            real mSpotExponent;      // [0.0f, 128.0f]
            real mSpotCutOffAngle;   // [0.0f, 90.0f] and [180.0f]
            real mAttenuationConstant; // >= 0.0f
            real mAttenuationLinear;
            real mAttenuationQuadratic;
    };
}

#endif
